package cn.zy.common.encryption;

import java.util.UUID;

/**
 * 验证码公共类
 *
 * @param
 * @author 王磊
 * @date 2021/6/18 14:25
 * @param
 * @return null
 */
public class AuthRandomUtils {

    /**
     * 生成验证码
     *
     * @param number
     * @return java.lang.String
     */
    public static String getAuthCode(int number){

        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < number; i++) {
            int random = (int) (Math.random() * 9);
            sb.append(random);
        }
        return sb.toString();
    }


    /**
     * 生成UUID
     * @return
     */
    public static String getUUID(){
       return   UUID.randomUUID().toString();
    }


    /**
     * 版本号加0.1
     * @param version
     * @return
     */
    public static String versionAdd(String version ){
        double v = Double.parseDouble(version);
        v+=v;
        return String.valueOf(v);
    }
}
